package com.bicon.botu.mall.base.service.impl;

import com.bicon.botu.core.base.repository.redis.RedisHandler;
import com.bicon.botu.mall.base.service.TranceRecommendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static com.bicon.botu.mall.base.common.BaseConstants.BOTU_MALL_TRANCE_RECOMMEND_URL;

/**
 * <p>
 * <p> 定制推荐服务
 * </p>
 *
 * @author tao.zeng.
 * @since 2018/3/15.
 */
@Service
public class TranceRecommendServiceImpl implements TranceRecommendService {

    @Autowired
    private RedisHandler redisHandler;

    @Override
    public boolean add(String pictureUrl) {
        return redisHandler.getLocalRedisTemplate().cacheStringValue(BOTU_MALL_TRANCE_RECOMMEND_URL, "", pictureUrl);
    }

    @Override
    public String get() {
        return redisHandler.getLocalRedisTemplate().getStringValue(BOTU_MALL_TRANCE_RECOMMEND_URL, "");
    }
}
